<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	{include="style"}
	<style>
	.layui-form-pane .layui-form-label{
		width:100%;
	}
	.layui-form-pane .layui-input-block{
		margin-left:0;
	}
	</style>

</head>
<body >
  <div class="layui-rows" style="    margin: 10px;">
  <blockquote class="layui-elem-quote">如果项目模板文件目录不是[ Home/<span style="color:#f00">template</span> ]，请设置你的项目模板文件目录</blockquote>
    <form class="layui-form layui-form-pane" action="">
	<input name="id" type="hidden" value="{$plugins['id']}">
	
	<div class="xlx">
	  <div class="layui-form-item">
		<label class="layui-form-label">模板目录</label>
		<div class="layui-input-block">
		  <input type="text" name="template"  required  lay-verify="required" value="{if(isset($config['template']))}{$config['template']}{else}template{/if}" placeholder="" autocomplete="off" class="layui-input">
		</div>
		<div class="layui-form-mid layui-word-aux">默认template</div>
	  </div>
	
	   <div class="layui-form-item" >
		<div class="layui-input-block" style="text-align:center;">
		  <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
	
		</div>
	  </div>
	  </div>
	
	</form>
</div>

    <script>
        $(function  () {
			
            layui.use('form', function(){
              var form = layui.form;
             
              //监听提交
              form.on('submit(formDemo)', function(data){
           
				$.post("{fun U('setconf')}",data.field,function(res){
				    //console.log(res);return false;
					 var res = JSON.parse(res);
					 if(res.code==1){
						layer.msg(res.msg);
					 }else{
						layer.msg(res.msg, {icon: 6,time: 2000},function(){
						window.location.reload();
						});
                     
						
						 
					 }
				})
				
                return false;
              });
			  
			  
			  
			  
            });
        })

        
    </script>

    
 
</body>
</html>